<template>
 <div>
  <input type="text" v-if="!flag" v-focus @blur="flag=!flag">
  <button @click="flagchange" v-if="flag">+ new tag</button>
 </div>
</template>
<script>
export default{
    name:'',
    data () {
        return {
            flag:true
        }
    },
    created () {
    },
    computed:{
    },
    directives:{
      focus:{
        inserted(el){
          el.focus()
        }
      }
    },
    methods:{
      flagchange(){
        this.flag = !this.flag
      }
    }
}
</script>
<style lang='less'  scoped>
    
</style>
